package com.santiao.publics.util;

import com.santiao.publics.config.Const;
import com.santiao.publics.config.Logger;

/**
 * Log统一管理类
 *
 * 
 */
public class LogUtil {

    private LogUtil() {
        throw new UnsupportedOperationException("cannot be instantiated");
    }


    private static boolean isDebug = Const.APP_TEST;

    // 下面是传入自定义tag的函数

    public static void i(String tag, String msg) {
        if (isDebug) {
            Logger.i(tag, msg);
        }
    }

    public static void d(String tag, String msg) {

        if (isDebug) {
            StackTraceElement[] s = Thread.currentThread().getStackTrace();
            int lines = s[3].getLineNumber();
            String methodName = s[3].getMethodName();
            String content = lines + " --> " + methodName + " == " + msg;
            Logger.d(tag, content);
        }
    }


    public static void e(String tag, String msg) {
        if (isDebug) {
            Logger.e(tag, msg);
        }
    }

    public static void v(String tag, String msg) {
        if (isDebug) {
            Logger.v(tag, msg);
        }
    }
}